﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLDC.Common.Estate;
using System.Configuration;

namespace ZLDC.Estate.UM
{
    public partial class TraneCustomer : _PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) 
            {
                ZLDC.Topo.BLL.Estate.SystemParamBLL.LoadMarkParamType(slstatus, false, "客源状态");
                slstatus.Items.Insert(0, "全部");
                string deptid = _Utility.GetInfoBySession().m_sDeptID;

               
                ddlDept1.DataSource = ZLDC.DAL.Estate.DeptDAL.getGetAllChildrenDept(deptid, "");
                ddlDept1.DataTextField = "deptname";
                ddlDept1.DataValueField = "id";
                ddlDept1.DataBind();
                ddlDept1.Items.Insert(0, new ListItem("请选择", ""));
                slusername.Items.Insert(0, new ListItem("请选择", ""));

                ddlDept2.DataSource = ZLDC.DAL.Estate.DeptDAL.getGetAllChildrenDept(deptid, "");
                ddlDept2.DataTextField = "deptname";
                ddlDept2.DataValueField = "id";
                ddlDept2.DataBind();
                ddlDept2.Items.Insert(0, new ListItem("请选择", ""));
                slusername1.Items.Insert(0, new ListItem("请选择", ""));
            }
        }

        protected void ddlDept1_SelectedIndexChanged(object sender, EventArgs e)
        {
            slusername.Items.Clear();
            // ZLDC.DAL.Estate.DeptDAL.GetUserListForTran(ddlusername, this.ddlDept1.SelectedValue.ToString().Trim(), 0);
            ZLDC.DAL.Estate.DeptDAL.GetUserListForTran(slusername,ddlDept1.SelectedValue.ToString(), 1);
            slusername.Items.Insert(0, new ListItem("请选择", ""));
        }

        protected void ddlDept2_SelectedIndexChanged(object sender, EventArgs e)
        {
            slusername1.Items.Clear();
            ZLDC.DAL.Estate.DeptDAL.GetUserList(slusername1, ddlDept2.SelectedValue.ToString());
            slusername1.Items.Insert(0, new ListItem("请选择", ""));
        }
    }
}
